/**
 * @description 格式化日期时间为 YYYY/MM/DD HH:mm 格式
 * @param dateTime 待格式化的日期时间
 */
export function formatDateTime(dateTime: Date): string {
  if (!dateTime) return '';

  const year = dateTime.getFullYear();
  const month = String(dateTime.getMonth() + 1).padStart(2, '0');
  const day = String(dateTime.getDate()).padStart(2, '0');
  const hours = String(dateTime.getHours()).padStart(2, '0');
  const minutes = String(dateTime.getMinutes()).padStart(2, '0');

  return `${year}/${month}/${day} ${hours}:${minutes}`;
}
